package queryid

import (
	"time"

	"gitee.com/hlwqds/clientSimulation/src/lib/lg"
)

//Options have following members
type Options struct {
	// basic options
	LogLevel  lg.LogLevel `flag:"log-level"`
	LogPrefix string      `flag:"log-prefix"`
	LogPath   string      `flag:"log-path"`

	RedisAddress             string        `flag:"redis-address"`
	RedisPassword            string        `flag:"redis-password"`
	HTTPAddress              string        `flag:"http-address"`
	HTTPClientConnectTimeout time.Duration `flag:"http-client-connect-timeout" cfg:"http_client_connect_timeout"`
	HTTPClientRequestTimeout time.Duration `flag:"http-client-request-timeout" cfg:"http_client_request_timeout"`
}

//NewOptions create options and fill it with default value
func NewOptions() *Options {
	return &Options{
		LogPrefix:                "[QueryID] ",
		LogLevel:                 lg.INFO,
		LogPath:                  "./test.log",
		RedisAddress:             "0.0.0.0:6379",
		RedisPassword:            "",
		HTTPAddress:              "0.0.0.0:8776",
		HTTPClientConnectTimeout: 2 * time.Second,
		HTTPClientRequestTimeout: 5 * time.Second,
	}
}
